package spring.data.specification.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
 * 描述: TODO:
 * 包名: spring.data.specification.entity.
 * 作者: barton.
 * 日期: 16-7-2.
 * 项目名称: spring-data
 * 版本: 1.0
 * JDK: since 1.8
 */
@Entity
@Table(name = "SYS_MANAGER")
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler"})
public class Manager implements Serializable {

  /**
   * @Fields serialVersionUID : TODO(用一句话描述这个变量表示什么)
   */

  private static final long serialVersionUID = -4389885527660615969L;
  @Id
  @GeneratedValue(generator = "foreign")
  @GenericGenerator(name = "foreign", strategy = "foreign", parameters = {
   @Parameter(name = "property", value = "user")})
  @Column(name = "user_id")
  private String id;

  private String truename;

  private String jobNum;

  private String mobile;

  @OneToOne(fetch = FetchType.LAZY)
  @JoinColumn(name = "region_id")
  private Region region;

  @OneToOne(fetch = FetchType.LAZY)
  @JoinColumn(name = "user_id")
  private SysUser sysUser;
  @Temporal(TemporalType.DATE)
  private Date regdate;

  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public String getTruename() {
    return truename;
  }

  public void setTruename(String truename) {
    this.truename = truename;
  }


  public String getJobNum() {
    return jobNum;
  }

  public void setJobNum(String jobNum) {
    this.jobNum = jobNum;
  }

  public Region getRegion() {
    return region;
  }

  public void setRegion(Region region) {
    this.region = region;
  }

  public SysUser getSysUser() {
    return sysUser;
  }

  public void setSysUser(SysUser sysUser) {
    this.sysUser = sysUser;
  }

  public String getMobile() {
    return mobile;
  }

  public void setMobile(String mobile) {
    this.mobile = mobile;
  }

  public Date getRegdate() {
    return regdate;
  }

  public void setRegdate(Date regdate) {
    this.regdate = regdate;
  }

  @Override
  public String toString() {
    return "Manager [id=" + id + ", truename=" + truename + ", jobNum="
     + jobNum + ", mobile=" + mobile + ", regdate=" + regdate + "]";
  }

}
